package com.ycsyxt.guide;

import java.util.Arrays;

/**
 * @author ycs(15241496739 @ 163.com)
 * @date 2022/6/12
 **/
public class Class10 {
    public static void main(String[] args) {
        // 三种货币2,3,7，凑100的最少个数
        int[] value = new int[]{2, 3, 7};
        int[] dp = new int[101];
        Arrays.fill(dp, Integer.MAX_VALUE);
        dp[0] = 0;
        for (int i = 0; i < value.length; i++) {
            for (int j = value[i]; j < 101; j++) {
                if (dp[j - value[i]] != Integer.MAX_VALUE) {
                    dp[j] = Math.min(dp[j], dp[j - value[i]] + 1);
                }
            }
        }
        System.out.println(dp[100]);
    }
}
